import * as constants from '../Constants'
import { get, GET_SUPPLIER_INFO } from '../../service/api'

export interface RecordSupplierInfo {
  type: constants.RecordSupplierInfo,
  payload: Promise<any>
}

export interface RecordSupplierInfo_FULFILLED {
  type: constants.RecordSupplierInfo_FULFILLED,
  payload: any
}
export interface RecordSupplierInfo_PENDING {
  type: constants.RecordSupplierInfo_PENDING
}

export type SupplierInfoAction = RecordSupplierInfo | RecordSupplierInfo_FULFILLED | RecordSupplierInfo_PENDING

//记录band信息
export function recordSupplierInfo(info: any): RecordSupplierInfo {
  return {
    type: constants.RecordSupplierInfo,
    payload: get(GET_SUPPLIER_INFO, info)
  }
}